package zuo.Jiaoliang05;

import java.util.Scanner;
/*2.定义一个分数数组：double[] arr = {88.5,96,97,74,88.2,58.5,77.9,90,99};
        计算分数数组中去掉最低分的平均分，并打印*/

public class jiao003 {
    public static void main(String[] args) {
        double avg=0;
       double arr[] = {88.5,96,97,74,88.2,58.5,77.9,90,99};
        double sum=0;
        double min=arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(min>arr[i]){
                min=arr[i];
            }
            sum+=arr[i]; //每个输入的数求和
        }

         avg= (sum-min)/(arr.length-1);
        System.out.println("数组平均数="+avg);
    }
}
